<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2018-01-25 15:37:06
 * @Description: 用户积分记录
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-20 09:00:16
 * @FilePath: /归档/user/2018_01_25_152218_create_user_sign_log.php
 */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserSignLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_sign_logs', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('user_id')->default(0)->comment('用户id');
            $table->unsignedInteger('point')->default(0)->comment('积分数变化');
            $table->tinyInteger('type')->default(1)->comment('1增加，0消费');
            $table->smallInteger('days')->default(0)->comment('累计天数');
            $table->timestamp('signtime')->nullable()->comment('签到日期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_sign_logs');
    }
}
